package kuaidi.presenter;

import java.util.Map;

import kuaidi.api.constanst.BaseSubscriber;
import kuaidi.api.constanst.ExceptionHandle;
import kuaidi.entity.kuaidijieguo.Kdjg;
import kuaidi.model.ModelFactory;
import kuaidi.view.impl.KdjgView;

/**
 * Created by John on 2016/11/1.
 */

public class KdjgPersenter {
    private KdjgView kdjgView;

    public KdjgPersenter(KdjgView kdjgView) {
        this.kdjgView = kdjgView;
    }
    public void getKdjgData(Map<String,String> params){
        ModelFactory.getiKuaidiModel().getKdjgData(params, new BaseSubscriber<Kdjg>() {
            @Override
            public void onSuccess(Kdjg kdjg) {
                kdjgView.onSuccess(kdjg);
            }

            @Override
            public void onFail(ExceptionHandle.ResponeThrowable e) {
                kdjgView.onFail(e);
            }

            @Override
            public void onFinished() {
                kdjgView.onFinish();
            }
        });
    }
}
